//
//  AddBankView.m
//  Kjs-iOS
//
//  Created by 江伟 on 16/6/24.
//  Copyright © 2016年 jmhz. All rights reserved.
//

#import "AddBankView.h"

@interface AddBankView()

@end

@implementation AddBankView
- (void)awakeFromNib {
    
    UITapGestureRecognizer *goAddBankCard = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(AddBankCard)];
    self.addBankView.userInteractionEnabled = YES;
    [self.addBankView  addGestureRecognizer:goAddBankCard];
    
    self.addBankView.layer.cornerRadius = 5;
    CAShapeLayer *borderLayer = [CAShapeLayer layer];
    borderLayer.bounds = CGRectMake(0, 0, self.addBankView.frame.size.width, self.addBankView.frame.size.height);
    borderLayer.position = CGPointMake(CGRectGetMidX(self.addBankView.bounds), CGRectGetMidY(self.addBankView.bounds));
    borderLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.addBankView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight |UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)].CGPath;
    borderLayer.lineWidth = 1. / [[UIScreen mainScreen] scale];
    //虚线边框
    borderLayer.lineDashPattern = @[@8, @8];
    borderLayer.fillColor = [UIColor clearColor].CGColor;
    borderLayer.strokeColor = [UIColor colorWithRed:102/255.0f green:102/255.0f blue:102/255.0f alpha:1].CGColor;
    [self.addBankView.layer addSublayer:borderLayer];
    
}
-(void)AddBankCard
{
    if (self.goAddBankCard) {
        self.goAddBankCard();
    }
}
@end
